Component({
    properties: {},
    data: {
        maxYear: 0,
        maxMonth: 0,
        currentYear: 0,
        currentSelectedYear: 0,
        currentMonth: 0,
        monthList: []
    },
    lifetimes: {
        attached: function() {
            var t = new Date();
            this.setData({
                currentSelectedYear: t.getFullYear(),
                maxYear: t.getFullYear(),
                currentYear: t.getFullYear(),
                maxMonth: t.getMonth() + 1,
                currentMonth: t.getMonth() + 1
            }), this.setMonthItem();
        },
        moved: function() {},
        detached: function() {}
    },
    ready: function() {},
    methods: {
        prevYear: function() {
            this.setData({
                currentSelectedYear: this.data.currentSelectedYear - 1
            }), this.setMonthItem();
        },
        nextYear: function() {
            this.setData({
                currentSelectedYear: this.data.currentSelectedYear + 1
            }), this.setMonthItem();
        },
        selectedMonth: function(t) {
            var e = t.currentTarget.dataset.item;
            1 != e.enabled && (this.setData({
                currentYear: this.data.currentSelectedYear,
                currentMonth: e.num
            }), this.triggerEvent("selectedMonth", {
                year: this.data.currentYear,
                month: this.data.currentMonth
            }));
        },
        setMonthItem: function() {
            this.monthList = [];
            var t = this.data.maxYear, e = this.data.maxMonth, a = this.data.currentYear, r = this.data.currentMonth, n = this.data.currentSelectedYear;
            console.log(t, e, a, r);
            for (var h = [], s = 1; s <= 12; s++) {
                var c = {};
                c.num = s, c.enabled = !1, n >= t && s > e && (c.enabled = !0), h.push(c);
            }
            this.setData({
                monthList: h
            }), console.log(this.data.monthList);
        }
    }
});